<?php
namespace recite\controllers;

use Yii;
use yii\web\Controller;

/**
 * Site controller
 */
class TestController extends Controller{


    /**
     * Displays homepage.
     *
     * @return mixed
     */
    public function actionIndex(){
        $db = Yii::$app->db;

       // $sql = "INSERT INTO recite_knowledge(c1, c2, c3, cid, question, answer, last_right_time)  VALUES(2, 0, 0, 2, 'sdf', 'dfg', now())";
        $sql = "INSERT INTO recite_knowledge(c1, c2, c3, cid, question, answer)  VALUES(2, 0, 0, 2, 'sdf', 'dfg')";
        $command = $db->createCommand($sql);
         //echo $command->getRawSql();exit;
       $line = $command->execute();
        var_dump($line);

        $id = $db->getLastInsertID();
        var_dump($id);
    }

}
